<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width,height=device-height,initial-scale=1.0,user-scalable=no,minimum-scale=1.0,maximum-scale=1.0"/>
    <title th:text="${question.getTitle()}"></title>
    <div th:include="head :: res"></div>
</head>
<body class="container">
<div th:include="head :: header-nav"></div>
<div class="jumbotron">
    <h1 th:text="${question.getTitle()}"></h1>
    <p th:text="${question.getDescribe()}"></p>
</div>
<div th:each="answer : ${list}">
    <div class="row"><span th:text="${answer.getCreateBy().getName()}"></span>
        回答于<span th:text="${#dates.format(answer.getCreateDate(), 'yyyy-MM-dd HH:mm:ss')}">"></span>
        <a th:href="@{/answer/delete/} + ${answer.getId()}" >删除</a>
    </div>
    <div class="card">
        <div th:text="${answer.getContent()}" class="card-body"></div>
    </div>
    <br>
</div>
<div class="try-online"><a class="btn-try btn btn-success btn-lg btn-block disabled"></a></div>
<div class="row">
    <form action="/answer"
          method="post" class="form-horizontal">
        <input type="hidden" name="question" th:value="${question.getId()}">
        <div class="form-group">
            <div class="col-sm-10">
                <textarea type="text" class="form-control form-text" id="inputEmail3" name="content"
                          rows="4" cols="9000"></textarea>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="submit" class="btn btn-primary">发布</button>
            </div>
        </div>
    </form>
</div>
</body>
</html>